//
//  ZOEDatePickerView.h
//  HealthyCity
//
//  Created by xxb on 2017/8/17.
//  Copyright © 2017年 智业互联网络科技有限公司 艾嘉健康. All rights reserved.
//

#import <UIKit/UIKit.h>

@class ZOEDatePickerView;

typedef NS_ENUM(NSUInteger, ShowMode) {
    ShowInView = 0,
    ShowInWindow = 1
};

typedef NS_ENUM(NSUInteger, DatePickerMode) {
    DatePickerModeYear = 0, //年
    DatePickerModeYearMonth = 1, //年月
    DatePickerModeYearMonthDay = 2, //年月日
    DatePickerModeYearMonthDayHour = 3, //年月日时
    DatePickerModeYearMonthDayHourMinute = 4, //年月日时分
    DatePickerModeTwoYearMonth = 11 , //两个日期，年月
    DatePickerModeHourMinute = 5, //时分：09:00 12小时制，带有上午/下午
    DatePickerModeHourMinute24 = 6 //时分 24小时制
};

@protocol ZOEDatePickerViewDelegate <NSObject>

@optional
/**
 ShowInWindow模式下，不要用这个方法
 
 @param date date description
 */
-(void)selectedWithDate:(NSDate*)date;

/**
 ShowInWindow模式专用
 
 @param date date description
 */
-(void)confirmWithDate:(NSDate*)date;
-(void)confirmWithDate:(NSDate*)date date1:(NSDate*)date1;
-(void)datePickerView:(ZOEDatePickerView*)datePickerView confirmWithDate:(NSDate*)date;
-(void)datePickerView:(ZOEDatePickerView*)datePickerView confirmWithDate:(NSDate*)date date1:(NSDate*)date1;
-(void)confirmWithDate:(NSDate*)date string:(NSString*)string;
-(void)datePickerView:(ZOEDatePickerView*)datePickerView confirmWithDate:(NSDate*)date string:(NSString*)string;

@end

@interface ZOEDatePickerView : UIView

/**
 允许超过今天，默认为不允许
 */
@property (nonatomic, assign) BOOL overTodayAllow;

/**
 是否显示单位，默认显示
 */
@property (nonatomic, assign) BOOL unitDisabled;

/**
 标题
 */
@property (nonatomic, copy) NSString *title;

/**
 默认日期
 */
@property (nonatomic, strong) NSDate *defaultDate;
@property (nonatomic, weak) id<ZOEDatePickerViewDelegate> delegate;

/**
 初始化方法

 @param showMode 展示形式：在view内部还是在底部
 @param datePickerMode 日期展示形式
 @return return value description
 */
-(instancetype)initWithMode:(ShowMode)showMode andDatePickerMode:(DatePickerMode)datePickerMode;

/**
 初始化方法
 
 @param frame 大小。ShowInWindow模式下无效
 @param showMode 展示形式：在view内部还是在底部
 @param datePickerMode 日期展示形式
 @return return value description
 */
-(instancetype)initWithFrame:(CGRect)frame andMode:(ShowMode)showMode andDatePickerMode:(DatePickerMode)datePickerMode;

/**
 初始化方法

 @param showMode 展示形式：在view内部还是在底部
 @param datePickerMode 日期展示形式
 @param defaultDate 默认时间
 @return return value description
 */
-(instancetype)initWithMode:(ShowMode)showMode andDatePickerMode:(DatePickerMode)datePickerMode andDefualtDate:(NSDate*)defaultDate;

/**
 初始化方法
 
 @param frame 大小。ShowInWindow模式下无效
 @param showMode 展示形式：在view内部还是在底部
 @param datePickerMode 日期展示形式
 @param defaultDate 默认时间
 @return return value description
 */
-(instancetype)initWithFrame:(CGRect)frame andMode:(ShowMode)showMode andDatePickerMode:(DatePickerMode)datePickerMode andDefualtDate:(NSDate*)defaultDate;

/**
 如果是ShowInView，不响应
 */
- (void)show;

/**
 如果是ShowInView，不响应
 */
- (void)hide;

@end

